<!-- 冈好办-已办事项公开-更多 -->
<template>
  <div class="container">
    <template v-if="!loading && list.length">
      <div class="item" v-for="(item, index) in list" @click="toPage('pages/tuanOnline/masses/transactItemDetail', {id: item.id})" :key="index">
        <div class="title">{{item.content}}</div>
        <div class="card-time" style="display: flex; justify-content: space-between;">
          <div>申请时间：{{item.createDate}}</div>
          <div style="color: #67C23A;">已办结</div>
        </div>
      </div>
    </template>
    <Empty v-if="!loading && !list.length"></Empty>
  </div>
</template>
<script>
import Empty from "../../../components/Empty.vue";
import { getTransactItemListAPI } from "../../../api/tuan"
export default {
  components: { Empty },
  data() {
    return {
      loading: false,
      list: [],
      title: "",
      typeName: "事项清单",
    };
  },
  onShareAppMessage() {},
  onLoad() {
    this.loading = true;
    wx.showLoading({
      title: "加载中...",
    });
    getTransactItemListAPI().then((res) => {
      this.list = res.data;
      wx.hideLoading();
      this.loading = false;
    });
  },
  methods: {
    toDetail(item) {
      this.toPage("pages/tuanOnline/masses/detail", {
        id: item.id,
        title: item.title,
        publishTime: item.publishTimeStr,
        content: item.content,
      });
    },
    toPage(url, params) {
      this.$u.route({ url, params });
    },
  },
};
</script>
<style scoped lang="scss">
@import "../../../assets/scss/common.scss";

.container {
  min-height: 100vh;
  background-color: #fff;
  box-sizing: border-box;
  padding: 5px 15px;
  .item {
      border-bottom: 1px solid #efefef;
      padding: 10px 5px;
      &:last-child {
          border: none;
      }
      .title {
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 1;
          overflow: hidden;
          margin-bottom: 5px;
          color: #0c92ff;
      }
      .time {
          color: $color_secondary-text;
      }
  }
}
</style>
